﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AssetManagementSystem.Model
{
    public class Asset
    {
        string id;
        string name;
        string groupName;
        string description;
        Dictionary<string, string> properties;

        public Asset(string id, string name, string groupName, string description, Dictionary<string, string> properties) {
            this.id = id;
            this.name = name;
            this.groupName = groupName;
            this.description = description;
            this.properties = properties;
        }

        public string Id {
            get { return id; }
        }

        public string Name {
            get { return name; }
        }

        public string GroupName {
            get { return groupName; }
        }

        public string Description {
            get { return description; }
        }

        public Dictionary<string, string> Properties {
            get { return properties; }
            set { this.properties = value; }
        }

        public override string ToString() {
            string assetString = id + " ";
            assetString += name + " ";
            assetString += groupName + " ";
            assetString += description;

            foreach (KeyValuePair<string, string> property in properties) {
                assetString += " " + property.Key + ":" + property.Value;
            }

            return assetString;
        }
    }
}
